<!-- Page to allow a user to post a question -->

<%@ include file="header.jsp" %>
<script type="text/javascript">
function setCurrentMenu(){
	
	document.getElementById("1").setAttribute('style', 'background:#999999');
	document.getElementById("2").setAttribute('style', 'background:#999999');
	document.getElementById("3").setAttribute('style', 'background:#999999');
	document.getElementById("4").setAttribute('style', 'background:#0093e7');
}
</script>
<!-- Checking whether the user has logged in or not.If no, then redirecting 
	the user to the login page. -->
<%
	if(session.getAttribute("userName")==null && session.getAttribute("adminName")==null){
	response.sendRedirect("login.jsp");
  	}
%>
<form action="AskQuestion"  method="post" name="theForm" onsubmit="return doValidate()">
	<b>* Title</b><br />
	<input type="text" name="title" size="128" maxlength="500" id="title" onclick='clearTarget("title_error")'/><br />

	<!-- Error division for title textbox. -->
	
	<div id="title_error">&nbsp;</div><br />

	<b>Description(Optional)</b><br />
	<textarea  id="description" name="description"  rows="15" cols="80" style="width: 80%" onclick='clearTarget("desc_error")'>
	</textarea>
	<br/>
	<b>* Tags</b><br />
	<div> 
		<input type="text" size="30" autocomplete="off" maxlength="100" name="tags" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" onClick='clearTarget("tags_error");lookup(this.value);'/>
	</div>
	<div class="suggestionsBox" id="suggestions" style="display:none;z-index:1">
	<div class="suggestionList" id="autoSuggestionsList" style="z-index:1">
	</div>
	</div>

	<!-- Error division for tags textbox. -->
	<div id="tags_error" style="z-index: -1">&nbsp;</div>
	<br/>

<div style="z-index: -1">
	<!-- Captcha verification -->
	<b>*Captcha</b><br/>
 		<img src="CaptchaServlet"><br/>
  		<input type="text" autocomplete="off" name="answer"/><br /> 
  		
  		<div style="margin-top: 10px;margin-bottom:20px;height: 20px;color: red;">
  	<!-- Checking whether the captcha is null or not and displaying the error message.-->
    	<% 
    		if(session.getAttribute("captcha_status")!=null){
    	%>
    	<b>Captcha MisMatch !!</b>
    	<%
    		session.removeAttribute("captcha_status");
       		}
   		%>
   		</div>
   		<!-- Validating the text fields -->
 	<!-- <a href="javascript:doValidate();" style="text-decoration: none">
	   	<input type="button" style="height:35px;width:150px;" value="Post Your Question"/>
  	</a>  -->
 </div>
	   	<input type="submit" style="height:35px;width:150px;" value="Post Your Question"/>

</form>

<%@ include file="footer.jsp" %>